<?php

namespace app\manager;

class RedisInstance
{

    private static $redis ;

    public static function getIns(){
        if (empty(self::$redis)){
            $host = config('app.host');
            $port = config("app.port");
            $pwd = config('app.pwd');
            self::$redis =  new RedisDriver($host,$port,$pwd);
        }
    }

    public static function __callStatic($name, $arguments)
    {
        self::getIns();
        $res = [self::$redis,$name];
        $data = call_user_func_array($res, $arguments);
        return $data;
    }
}